<template>
	<div>
		<div class="sign_bg"></div>
		<div class="sign_tk">
			<u-loading mode="flower" size="100"></u-loading>
		</div>
	</div>
</template>

<script>
	export default {
	  data() {
	    return {
			
	    };
	  },
	  
	  onLoad(options) {
		  let WF_OrUnid = options.docUnid
		  if(this.isNotNull(WF_OrUnid)){
			   this.jump(WF_OrUnid)
		  }else{
			  setTimeout(() => {
				  uni.reLaunch({url:'/pages/index/index'})
			  }, 2000);
		  }
	  },
	  
	  methods:{
		  
		  async jump(WF_OrUnid){
			    
			    let data = await this.$u.api.unifyRequest({
			    	appid: 'AppletsPro',
			    	wf_num: 'R_AppletsPro_B002',
			    	userId: uni.getStorageSync('userInfo').userId,
			    	docUnid: WF_OrUnid,
			    	loading: false
			    });
			    if(data.code == 200){
			    	//判断是否是待办再决定如何跳转
			    	let result = await this.$u.api.unifyRequest({
			    		appid: 'AppletsPro',
			    		wf_num: 'R_AppletsPro_B007',
			    		userId: uni.getStorageSync('userInfo').userId,
			    		docUnid: data.data.docUnid,
			    		loading: false
			    	});
			    	if(result.data){
						setTimeout(() => {
							uni.reLaunch({url:data.data.pagepath})
						}, 1500);
			    	}else{
						setTimeout(() => {
							uni.reLaunch({url:data.data.url})
						}, 1500);
			    	}
			    }else{
			    	this.showMSG("error","出错啦！")
			    }
		  },
		  
	  }
	}
</script>

<style scoped>
	.sign_bg{
		position: absolute;
		left:0;
		top:0;
		width: 100%;
		height: 100%;
		background:rgba(0,0,0,0.6);
		z-index: 6;
		overflow: hidden;
	}
	
	.sign_tk{
		position: fixed;
		left: 50%;
		top:50%;
		margin-left: -1rem;
		margin-top: -2rem; 
		z-index: 7;
		text-align: center;
	}
</style>
